DeriveGamemode( "sandbox" )

GM.Name    = "Garry's Bots SVN"
GM.Author  = "LuaBanana, mahalis, craze"
GM.Email   = "fpsluabanana@gmail.com"
GM.Website = "http://code.google.com/p/garrysbots/"

function TimerCountdown()
	gb_RoundTimer = gb_RoundTimer - 1

	if gb_RoundTimer == 0 then
		if gb_CurrentRound == 1 then
			StartFight()
		elseif gb_CurrentRound == 2 then
			GameOver()
		end
	end

	local rf = RecipientFilter()
	rf:AddAllPlayers()

	umsg.Start("timercountdown", rf)
		umsg.Long(gb_RoundTimer)
	umsg.End()
end

function GM:Initialize()
	if SERVER then
		// Start roundtimer.
		timer.Create("RoundTimer", 1, 0, TimerCountdown)
	end

	// TEAMS NEED TO BE SET UP CLIENTSIDE & SERVERSIDE!!
	team.SetUp( 1, "Red Team", Color( 255, 0, 0, 255 ) )
	team.SetUp( 2, "Blue Team", Color( 0, 0, 255, 255 ) )
end
